/**
 * Created by Administrator on 2019/5/21/021.
 */
import CZML_GENERALTOOLS_CLASS from "./../main/CZML_GENERALTOOLS_CLASS.js"

class PRIMITIVE_ModelAnimationAction {
    constructor(viewer, id, index, StartTime) {
        this._viewer = viewer
        this.id = id
        this.index = index
        this.StartTime = StartTime
        this.PRIMITIVE_AddModelAnimationAction()
    }

    PRIMITIVE_AddModelAnimationAction() {
        const id = this.id
        const index = this.index
        const StartTime = this.StartTime
        const FindNode = CZML_GENERALTOOLS_CLASS.CzmlList.find(function(node) {
            return node.data().id === id
        })
        FindNode.data().readyPromise.then(function(model) {
            const StartTime1 = CZML_GENERALTOOLS_CLASS.Utcg2ISO8601TimeTransformation(StartTime)
            const staTime = Cesium.JulianDate.fromIso8601(StartTime1)
            FindNode.data().activeAnimations.add({
                startTime: staTime,
                index: index
            })
        })
    }
}
export default PRIMITIVE_ModelAnimationAction
